#pragma once

#include "connection_pool.hpp"
#include <mysql/mysql.h>

struct MySQLConfig {
    std::string host = "localhost";
    int port = 3306;
    std::string user;
    std::string password;
    std::string database;
    ConnectionPoolConfig pool_config;
};

class MySQLPool : public ConnectionPool<MYSQL> {
public:
    explicit MySQLPool(const MySQLConfig& config);
    ~MySQLPool() override = default;

protected:
    std::shared_ptr<MYSQL> create_connection() override;
    bool validate_connection(MYSQL* conn) override;
    void close_connection(MYSQL* conn) override;

private:
    MySQLConfig config_;
};